home *** CD-ROM | disk | FTP | other *** search
Wrap
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:out="urn:sample" xmlns:outscr="urn:twiddle" xmlns:SharePoint="Microsoft.SharePoint.WebControls" exclude-result-prefixes="xsl msxsl" version="1.0"> <xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes" /> <xsl:preserve-space elements="*"/> <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/> <xsl:namespace-alias stylesheet-prefix="outscr" result-prefix="msxsl"/> <!-- params designed to be overridden by the caller --> <xsl:param name="ID">1</xsl:param> <xsl:param name="TopLevel">1</xsl:param> <xsl:param name="FrameworkOnly">0</xsl:param> <xsl:param name="ViewSpec"> <View> <RowPath>/catalog/book</RowPath> <Fields> <Field FName="fld_1" FormFieldPrefix="ff_2" Value="title" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="title" ReadOnly="1" Type="text" Required="1"/> <Field FName="fld_2" FormFieldPrefix="ff_3" Value="author" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="author" ReadOnly="0" Type="text"/> <Field FName="fld_3" FormFieldPrefix="ff_4" Value="genre" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="genre" ReadOnly="1" Type="text"/> </Fields> </View> </xsl:param> <xsl:param name="StyleName">Table</xsl:param> <xsl:param name="ShowToolbar">0</xsl:param> <xsl:param name="DoXSLPaging">1</xsl:param> <xsl:param name="UsePaging">0</xsl:param> <xsl:param name="RowLimit">100</xsl:param> <xsl:param name="ShowHeader">0</xsl:param> <xsl:param name="ShowFooter">0</xsl:param> <xsl:param name="DoXSLJoin">0</xsl:param> <xsl:param name="GenerateForm">0</xsl:param> <xsl:param name="ShowFormToolbar">0</xsl:param> <xsl:param name="FormControlMode"></xsl:param> <xsl:param name="HasID">0</xsl:param> <xsl:param name="ShowTitle">0</xsl:param> <xsl:param name="DocLib">0</xsl:param> <!-- all localized text params --> <xsl:param name="dvt_ViewEmptyText">There are no items to display in this view.</xsl:param> <xsl:param name="ChooseText">Choose one...</xsl:param> <xsl:param name="PreviousLinkText">Previous</xsl:param> <xsl:param name="NextLinkText">Next</xsl:param> <xsl:param name="FirstLinkText">Start</xsl:param> <xsl:param name="PageItemText">Item</xsl:param> <xsl:param name="PageItemsText">Items</xsl:param> <xsl:param name="ViewText">View:</xsl:param> <xsl:param name="CountText">Count</xsl:param> <xsl:param name="AscendingText">Ascending</xsl:param> <xsl:param name="DescendingText">Descending</xsl:param> <xsl:param name="FilterText">Filter</xsl:param> <xsl:param name="YesText">Yes</xsl:param> <xsl:param name="NoText">No</xsl:param> <xsl:param name="EmptyOptionText">(Empty)</xsl:param> <xsl:param name="AllOptionText">(All)</xsl:param> <xsl:param name="DefaultLCID">1033</xsl:param> <xsl:param name="DefaultDateFormat">5</xsl:param> <xsl:param name="DefaultNumberFormat">#,##0.##;-#,##0.##</xsl:param> <xsl:param name="SaveButtonText">Save</xsl:param> <xsl:param name="CancelButtonText">Cancel</xsl:param> <xsl:param name="SaveLinkText">save</xsl:param> <xsl:param name="CancelLinkText">cancel</xsl:param> <xsl:param name="EditLinkText">edit</xsl:param> <xsl:param name="DeleteLinkText">delete</xsl:param> <xsl:param name="InsertLinkText">insert</xsl:param> <!-- global variables --> <xsl:variable name="basename" select="concat('dvt_',$ID)" /> <xsl:variable name="View" select="msxsl:node-set($ViewSpec)/View" /> <xsl:variable name="Style" select="/ViewStyles/Style[ID=$StyleName]" /> <xsl:variable name="Defaults" select="/ViewStyles/Defaults" /> <xsl:template match="/"> <xsl:choose> <xsl:when test="$FrameworkOnly = '1'"> <out:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" exclude-result-prefixes="xsl msxsl ddwrt"> <out:output method="html" indent="no"/> <out:decimal-format NaN=""/> <xsl:call-template name="gen-dvt-framework" /> </out:stylesheet> </xsl:when> <xsl:when test="$TopLevel = '1'"> <out:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" exclude-result-prefixes="xsl msxsl ddwrt"> <out:output method="html" indent="no"/> <out:decimal-format NaN=""/> <xsl:call-template name="gen-dvt-framework" /> <out:template match="/"> <out:call-template name="{$basename}"/> </out:template> <xsl:apply-templates select="$Style" /> </out:stylesheet> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$Style" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="gen-dvt-framework"> <!-- BEGIN: params set by runtime --> <out:param name="dvt_apos">'</out:param> <!-- END: params set by runtime --> <!-- automode variable, managed by DVT manager --> <out:variable name="{$basename}_automode">0</out:variable> <!-- generic template to display a header field --> <out:template name="dvt.headerfield"> <out:param name="fieldname"/> <out:param name="fieldtitle"/> <out:param name="displayname"/> <out:param name="sortable">1</out:param> <out:param name="fieldtype">0</out:param> <out:choose> <out:when test="($dvt_adhocmode = 'sort' or $dvt_fieldsort = '1')and $sortable='1'"> <out:variable name="sortfield"> <out:choose> <out:when test="substring($fieldname, string-length($fieldname) - 5) = '(text)'"> <out:value-of select="substring($fieldname, 1, string-length($fieldname) - 6)"/> </out:when> <out:when test="substring($fieldname, 1, 1) = '@'"> <out:value-of select="substring($fieldname, 2)"/> </out:when> <out:otherwise> <out:value-of select="$fieldname"/> </out:otherwise> </out:choose> </out:variable> <out:variable name="linkdir"> <out:choose> <out:when test="$dvt_sortfield = $sortfield and $dvt_sortdir = 'ascending'">descending</out:when> <out:otherwise>ascending</out:otherwise> </out:choose> </out:variable> <out:variable name="sortText"> <out:choose> <out:when test="$linkdir='descending'">' + 'descending' + '</out:when> <out:otherwise>' + 'ascending' + '</out:otherwise> </out:choose> </out:variable> <out:variable name="separator" select="' '"/> <out:variable name="connector" select="';'"/> <table CtxNum="1" cellspacing="0" class="ms-unselectedtitle"> <xsl:attribute name="onmouseover">OnMouseOverAdHocFilter(this, '{concat($displayname,$separator,$fieldname, $separator,$fieldtype, $connector, <xsl:value-of select="$DefaultLCID"/>, $separator, $dvt_partguid)}')</xsl:attribute> <tr><td width="100%" class="ms-vb" nowrap="nowrap"> <a> <out:attribute name="href">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_sortfield={{',$sortfield,'}};dvt_sortdir={{',$sortText,'}}'))" />;</out:attribute> <out:attribute name="onclick">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_sortfield={{',$sortfield,'}};dvt_sortdir={{',$sortText,'}}'))" />;</out:attribute> <out:choose> <out:when test="$fieldtype = 'Attachments'"> <out:value-of select="$fieldtitle" disable-output-escaping="yes"/> </out:when> <out:otherwise> <out:value-of select="$fieldtitle"/> </out:otherwise> </out:choose> <out:if test="$dvt_sortfield = $sortfield"> <out:choose> <out:when test="$dvt_sortdir = 'ascending'"> <img border="0" alt="{$AscendingText}" src="{{ddwrt:FieldSortImageUrl('Desc')}}" /> </out:when> <out:when test="$dvt_sortdir = 'descending'"> <img border="0" alt="{$DescendingText}" src="{{ddwrt:FieldSortImageUrl('Asc')}}" /> </out:when> </out:choose> </out:if> </a> <out:if test="contains($dvt_filterfields, concat($fieldname, ';' ))"> <IMG SRC="/_layouts/images/filter.gif" BORDER="0" ALT=""/> </out:if> </td> <td><img src="/_layouts/images/blank.gif" width="13" style="visibility: hidden" alt=""/></td> </tr> </table> </out:when> <out:otherwise> <out:choose> <out:when test="$fieldtype = 'Attachments'"> <out:value-of select="$fieldtitle" disable-output-escaping="yes"/> </out:when> <out:otherwise> <out:value-of select="$fieldtitle"/> </out:otherwise> </out:choose> </out:otherwise> </out:choose> <out:if test="$dvt_filterfield=$fieldname" ddwrt:cf_ignore="1"><img alt="{$FilterText}" src="{{ddwrt:FieldFilterImageUrl('')}}"/></out:if> </out:template> <!-- generic template to display a filter field --> <out:template name="dvt.filterfield"> <out:param name="fieldname"/> <out:param name="fieldtitle"/> <out:param name="Rows" /> <out:param name="fieldtype" /> <out:variable name="dvt_FieldNameNoAtSign" select="substring-after($fieldname, '@')"/> <out:variable name="filtertype"><out:if test="starts-with($fieldtype,'date')">date</out:if></out:variable> <out:variable name="sorttype"><out:choose><out:when test="starts-with($fieldtype,'number')">number</out:when><out:otherwise>text</out:otherwise></out:choose></out:variable> <out:variable name="clientText">' + this.options[this.selectedIndex].value + '</out:variable> <out:if test="not(contains($fieldname, '/')) and not(contains($fieldname, '['))" ddwrt:cf_ignore="1"> <out:value-of select="$fieldtitle"/> <out:text disable-output-escaping="yes">:<br></out:text> <select name="{{$fieldname}}_filterval"> <out:attribute name="onchange">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('NotUTF8;dvt_filterfield={{',$fieldname,'}};dvt_filtertype={{',$filtertype,'}};dvt_adhocmode={{false()}};dvt_filterval={{',$clientText,'}}'))" />;</out:attribute> <option value="##dvt_empty##"> <out:if test="$dvt_filterfield=$fieldname and $dvt_filterval=''"> <out:attribute name="selected">true</out:attribute> </out:if> <xsl:value-of select="$EmptyOptionText"/> </option> <option value="##dvt_all##"> <out:choose> <out:when test="not($dvt_filterfield)"> <out:attribute name="selected">true</out:attribute> </out:when> <out:when test="$dvt_filterfield!=$fieldname"> <out:attribute name="selected">true</out:attribute> </out:when> </out:choose> <xsl:value-of select="$AllOptionText"/> </option> <out:value-of select="ddwrt:NameChanged('',1)"/> <out:choose> <out:when test="starts-with($fieldname, '@')"> <out:variable name="dvt_Rows"> <out:for-each select="$Rows"> <out:sort select="@*[name()=$fieldname]" order="ascending" data-type="{{$sorttype}}"/> <out:copy-of select="." /> </out:for-each> </out:variable> <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(@*[name()=$dvt_FieldNameNoAtSign]=preceding-sibling::*[1]/@*[name()=$dvt_FieldNameNoAtSign])]/@*[name()=$dvt_FieldNameNoAtSign]"> <out:sort data-type="{{$sorttype}}" /> <out:call-template name="dvt.filteroption"> <out:with-param name="name" select="$fieldname"/> <out:with-param name="value" select="."/> <out:with-param name="type" select="$fieldtype"/> </out:call-template> </out:for-each> </out:when> <out:when test="$fieldname = '.'"> <out:variable name="dvt_Rows"> <out:for-each select="$Rows"> <out:sort select="." order="ascending" data-type="{{$sorttype}}"/> <out:copy-of select="." /> </out:for-each> </out:variable> <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(.=preceding-sibling::*[1])]"> <out:sort data-type="{{$sorttype}}" /> <out:call-template name="dvt.filteroption"> <out:with-param name="name" select="$fieldname"/> <out:with-param name="value" select="."/> <out:with-param name="type" select="$fieldtype"/> </out:call-template> </out:for-each> </out:when> <out:otherwise> <out:variable name="dvt_Rows"> <out:for-each select="$Rows"> <out:sort select="*[name()=$fieldname]" order="ascending" data-type="{{$sorttype}}"/> <out:copy-of select="." /> </out:for-each> </out:variable> <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(*[name()=$fieldname]=preceding-sibling::*[1]/*[name()=$fieldname])]/*[name()=$fieldname]"> <out:sort data-type="{{$sorttype}}" /> <out:call-template name="dvt.filteroption"> <out:with-param name="name" select="$fieldname"/> <out:with-param name="value" select="."/> <out:with-param name="type" select="$fieldtype"/> </out:call-template> </out:for-each> </out:otherwise> </out:choose> <out:value-of select="ddwrt:NameChanged('',1)"/> </select> </out:if> </out:template> <!-- generic template to display a filter field option tag --> <out:template name="dvt.filteroption"> <out:param name="name"/> <out:param name="value"/> <out:param name="type"/> <out:if test="not(starts-with($type,'date')) or ddwrt:NameChanged($value,1)"> <out:variable name="output"> <out:choose> <out:when test="$type = 'number'"> <out:value-of select="format-number($value,'{$DefaultNumberFormat}')"/> </out:when> <out:when test="starts-with($type,'number|')"> <out:variable name="spec" select="substring-after($type,'|')" /> <out:choose> <out:when test="contains($spec, 'lcid')"> <out:variable name="apos">'</out:variable> <out:variable name="realspec" select="substring-after($spec, $apos)"/> <out:variable name="formatspec" select="substring-before($realspec, $apos)"/> <out:variable name="formatspec2" select="substring-after($realspec, $apos)"/> <out:variable name="lcid" select="normalize-space(substring-after($formatspec2, ','))"/> <out:value-of select="format-number($value,string($formatspec), substring($lcid,2,string-length($lcid)-2))"/> </out:when> <out:otherwise> <out:value-of select="format-number($value,substring($spec,2,string-length($spec)-2))"/> </out:otherwise> </out:choose> </out:when> <out:when test="starts-with($type,'date')"> <!-- don't show time portion when formatting; use long date-only format --> <out:value-of select="ddwrt:FormatDate(string($value),{$DefaultLCID},3)"/> </out:when> <out:otherwise> <out:value-of select="$value"/> </out:otherwise> </out:choose> </out:variable> <option> <out:attribute name="value"> <out:value-of select="ddwrt:ConnEncode(normalize-space($value))" /> </out:attribute> <out:if test="$dvt_filterfield=$name and $dvt_filterval=normalize-space($value) and $dvt_filterval!=''"> <out:attribute name="selected">true</out:attribute> </out:if> <out:choose> <out:when test="string-length($output) > 40"> <out:value-of select="substring($output, 1, 40)"/> ... </out:when> <out:otherwise> <out:value-of select="$output"/> </out:otherwise> </out:choose> </option> </out:if> </out:template> </xsl:template> <xsl:template match="Style"> <!-- output all the templates --> <xsl:apply-templates select="Main"/> <xsl:call-template name="GenHeader"/> <xsl:apply-templates select="Body"/> <xsl:call-template name="GenFooter"/> <xsl:call-template name="GenSummary"/> <xsl:call-template name="GenEmpty"/> <xsl:apply-templates select="GroupHeader"/> <xsl:apply-templates select="GroupFooter"/> <xsl:apply-templates select="AutoMode"/> <!-- TODO: shouldn't generate these in a TopLevel template --> <xsl:if test="not($FormControlMode and $ShowTitle='1')"> <xsl:call-template name="GenToolbar"/> <xsl:call-template name="GenLVToolbar"/> <xsl:call-template name="GenCommandFooter"/> <xsl:call-template name="GenNavigation"/> <!-- form stuff --> <xsl:call-template name="GenFormActions"/> </xsl:if> <xsl:if test="not($FormControlMode and $ShowTitle='1') or $FormControlMode='New'"> <xsl:call-template name="GenRowInsert"/> </xsl:if> </xsl:template> <xsl:template name="gen-field-view"> <xsl:param name="xpath" /> <xsl:param name="title" /> <xsl:param name="type" /> <xsl:param name="rich" /> <xsl:choose> <!-- field Type="Note", a.k.a. rich text --> <xsl:when test="$type='Note'"> <xsl:choose> <xsl:when test="$rich='0'"> <out:value-of select="{$xpath}" /> </xsl:when> <xsl:otherwise> <out:value-of select="{$xpath}" disable-output-escaping="yes"/> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- field Type="Boolean", a.k.a. yes/no --> <xsl:when test="$type='Boolean'"> <out:choose> <out:when test="{$xpath}='1' or msxsl:string-compare(string({$xpath}),'{$YesText}','','i')=0 or msxsl:string-compare(string({$xpath}),'True','','i')=0"> <xsl:value-of select="$YesText"/> </out:when> <out:otherwise> <xsl:value-of select="$NoText"/> </out:otherwise> </out:choose> </xsl:when> <!-- field Type="URL", Format="Hyperlink" --> <xsl:when test="$type='Hyperlink'"> <a> <xsl:attribute name="href">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute> <out:value-of select="substring-after({$xpath}, ', ')"/> </a> </xsl:when> <!-- field Type="URL", Format="Image" --> <xsl:when test="$type='Image'"> <img border="0"> <xsl:attribute name="src">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute> <xsl:attribute name="alt">{substring-after(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute> </img> </xsl:when> <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" --> <xsl:when test="$type='DocHyperlink'"> <a> <xsl:attribute name="href">{<xsl:value-of select="$xpath"/>}</xsl:attribute> <out:value-of select="{$xpath}"/> </a> </xsl:when> <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" --> <xsl:when test="$type='DocImage'"> <img border="0"> <xsl:attribute name="src">{<xsl:value-of select="$xpath"/>}</xsl:attribute> <xsl:attribute name="alt">{<xsl:value-of select="$xpath"/>}</xsl:attribute> </img> </xsl:when> <!-- this indicates the field is actually a subview --> <xsl:when test="$type='view'"> <out:call-template name="{$xpath}"/> </xsl:when> <!-- view regen: expanded types for "number" --> <xsl:when test="substring-before($type,'|')='number'"> <out:value-of select="format-number({$xpath},{substring-after($type,'|')})"/> </xsl:when> <!-- view regen: default for "number" type --> <xsl:when test="$type='number'"> <out:value-of select="format-number({$xpath},'{$DefaultNumberFormat}')"/> </xsl:when> <!-- view regen: expanded types for "date" --> <xsl:when test="substring-before($type,'|')='date'"> <out:value-of select="ddwrt:FormatDate(string({$xpath}),{substring-after($type,'|')})"/> </xsl:when> <!-- view regen: expanded types for "date" --> <xsl:when test="substring-before($type,'|')='datetime'"> <out:value-of select="ddwrt:FormatDateTime(string({$xpath}),{substring-after($type,'|')})"/> </xsl:when> <!-- view regen: default for "date" type --> <xsl:when test="$type='date' or $type='datetime'"> <out:value-of select="ddwrt:FormatDate({$xpath},{$DefaultLCID},{$DefaultDateFormat})"/> </xsl:when> <!-- the default: just use a plain old xsl:value-of tag --> <xsl:otherwise> <out:value-of select="{$xpath}"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="gen-field-form"> <xsl:param name="xpath"/> <xsl:param name="xpathraw"/> <xsl:param name="title"/> <xsl:param name="type"/> <xsl:param name="keyname"/> <xsl:param name="keyxpath"/> <xsl:param name="formfieldprefix"/> <xsl:param name="choices"/> <xsl:param name="outputformat" /> <xsl:param name="IsInsertField"/> <xsl:variable name="OpString"> <xsl:choose> <xsl:when test="$IsInsertField = '1'">i</xsl:when> <xsl:otherwise>u</xsl:otherwise> </xsl:choose> </xsl:variable> <!-- generate special xpath if we're doing insert binding for hierarchical data --> <xsl:variable name="LocalKeyXPath"> <xsl:choose> <xsl:when test="$IsInsertField = '1' and $keyxpath = 'string($XPath)'"> <!-- // generate the correct xpath value for insertion CWString wzRowPath; GetRowPath(pwzDVT, wzRowPath, TRUE); CWString wzInsertKey; if (!wzRowPath.IsEmpty() && wzRowPath[0] == L'/') { wzInsertKey.Format(L"'%s[new]'", wzRowPath); } else { wzInsertKey.Format(L"concat(%s,'/%s[new]')", DVT_XPATH_PARAM_AS_STRING, wzRowPath); } --> <xsl:choose> <xsl:when test="starts-with($View/RowPath, '/')">'<xsl:value-of select="$View/RowPath"/>[new]'</xsl:when> <xsl:otherwise>concat(<xsl:value-of select="$keyxpath"/>,'/<xsl:value-of select="$View/RowPath"/>[new]')</xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise><xsl:value-of select="$keyxpath"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="$FormControlMode"> <xsl:variable name="FormOp"> <xsl:choose> <xsl:when test="$FormControlMode='New' or $OpString = 'i'">i</xsl:when> <xsl:otherwise>u</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="ControlMode"> <xsl:choose> <xsl:when test="$FormOp = 'i'">New</xsl:when> <xsl:otherwise><xsl:value-of select="$FormControlMode"/></xsl:otherwise> </xsl:choose> </xsl:variable> <SharePoint:FormField runat="server" id="{$formfieldprefix}{{$Pos}}" ControlMode="{$ControlMode}" FieldName="{substring-after($xpathraw, '@')}"> <xsl:if test="not($FormOp = 'i') and $HasID = '1'"> <xsl:attribute name="ItemId">{@ID}</xsl:attribute> </xsl:if> <xsl:if test="not($ControlMode = 'Display')"> <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$FormOp"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Value','ValueChanged','ID',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute> </xsl:if> </SharePoint:FormField> <xsl:if test="$ControlMode = 'New' or $ControlMode = 'Edit'"> <SharePoint:FieldDescription runat="server" id="{$formfieldprefix}description{{$Pos}}" FieldName="{substring-after($xpathraw, '@')}" ControlMode="{$FormControlMode}"/> </xsl:if> </xsl:when> <!-- fields that come enumerated with choices in their schema --> <xsl:when test="$choices"> <xsl:choose> <xsl:when test="$outputformat = 'RadioButtons'"> <SharePoint:DVRadioButtonList runat="server" id="{$formfieldprefix}{{$Pos}}"> <xsl:if test="not($IsInsertField = '1')"> <xsl:attribute name="SelectedValue">{<xsl:value-of select="$xpath"/>}</xsl:attribute> </xsl:if> <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedValue','SelectedIndexChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute> <xsl:for-each select="$choices/Choice"> <asp:ListItem><xsl:value-of select="@Value"/></asp:ListItem> </xsl:for-each> </SharePoint:DVRadioButtonList> </xsl:when> <xsl:otherwise> <SharePoint:DVDropDownList runat="server" id="{$formfieldprefix}{{$Pos}}"> <xsl:if test="not($IsInsertField = '1')"> <xsl:attribute name="SelectedValue">{<xsl:value-of select="$xpath"/>}</xsl:attribute> </xsl:if> <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedValue','SelectedIndexChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute> <xsl:for-each select="$choices/Choice"> <asp:ListItem><xsl:value-of select="@Value"/></asp:ListItem> </xsl:for-each> </SharePoint:DVDropDownList> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- field Type="Note", a.k.a. rich text --> <xsl:when test="$type='Note'"> <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}" TextMode="MultiLine"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox> </xsl:when> <!-- field Type="Boolean", a.k.a. yes/no --> <xsl:when test="$type='Boolean'"> <xsl:if test="not($IsInsertField = '1')"> <out:variable name="{$formfieldprefix}Checked"> <out:choose> <out:when test="{$xpath}='1' or msxsl:string-compare(string({$xpath}),'{$YesText}','','i')=0 or msxsl:string-compare(string({$xpath}),'True','','i')=0">true</out:when> <out:otherwise>false</out:otherwise> </out:choose> </out:variable> </xsl:if> <asp:checkbox runat="server" id="{$formfieldprefix}{{$Pos}}" text=" "><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="checked">{$<xsl:value-of select="$formfieldprefix"/>Checked}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Checked','CheckedChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:checkbox> </xsl:when> <!-- field Type="URL", Format="Hyperlink" --> <xsl:when test="$type='Hyperlink'"> <a> <xsl:attribute name="href">substring-before(<xsl:value-of select="$xpath"/>, ', ')</xsl:attribute> <out:value-of select="substring-after({$xpath}, ', ')"/> </a> </xsl:when> <!-- field Type="URL", Format="Image" --> <xsl:when test="$type='Image'"> <img border="0"> <xsl:attribute name="src">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute> <xsl:attribute name="alt">{substring-after(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute> </img> </xsl:when> <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" --> <xsl:when test="$type='DocHyperlink'"> <a href="{{{$xpath}}}"> <out:value-of select="{$xpath}"/> </a> </xsl:when> <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" --> <xsl:when test="$type='DocImage'"> <img border="0"> <xsl:attribute name="src">{<xsl:value-of select="$xpath"/>}</xsl:attribute> <xsl:attribute name="alt">{<xsl:value-of select="$xpath"/>}</xsl:attribute> </img> </xsl:when> <!-- this indicates the field is actually a subview --> <xsl:when test="$type='view'"> <!-- don't call the subview if we're an insert field --> <xsl:if test="not($IsInsertField = '1')"> <out:call-template name="{$xpath}"/> </xsl:if> </xsl:when> <!-- view regen: expanded types for "number" --> <xsl:when test="substring-before($type,'|')='number'"> <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox> </xsl:when> <!-- view regen: default for "number" type --> <xsl:when test="$type='number'"> <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox> </xsl:when> <!-- view regen: default for "date" type --> <xsl:when test="substring-before($type,'|')='date' or substring-before($type,'|')='datetime' or $type='dateTime'"> <SharePoint:DateTimeControl runat="server" id="{$formfieldprefix}{{$Pos}}"> <xsl:if test="not($IsInsertField = '1')"> <xsl:attribute name="SelectedDate">{<xsl:value-of select="$xpathraw"/>}</xsl:attribute> </xsl:if> <xsl:if test="$outputformat = 'DateOnly'"> <xsl:attribute name="DateOnly">true</xsl:attribute> </xsl:if> <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedDate','DateChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute> </SharePoint:DateTimeControl> </xsl:when> <!-- the default: just use an asp:textbox --> <xsl:otherwise> <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}"> <xsl:if test="not($IsInsertField = '1')"> <xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute> </xsl:if> <xsl:if test="$outputformat = 'multiLineText'"> <xsl:attribute name="TextMode">MultiLine</xsl:attribute> </xsl:if> <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute> </asp:textbox> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="gen-param"> <out:param name="{@Name}"> <xsl:value-of select="@Default"/> </out:param> </xsl:template> <xsl:template match="Main"> <!-- this is the root template for the DVT --> <out:template name="{$basename}"> <xsl:for-each select="$Style/Params/Param"> <xsl:call-template name="gen-param" /> </xsl:for-each> <out:variable name="dvt_StyleName"><xsl:value-of select="$StyleName" /></out:variable> <xsl:if test="$DoXSLJoin = '1'"> <out:variable name="dvt_ParentRow"> <xsl:attribute name="select">current()</xsl:attribute> </out:variable> </xsl:if> <out:variable name="Rows" select="{$View/RowPath}" /> <!-- TODO: shouldn't generate these in a TopLevel template --> <xsl:if test="$ShowToolbar = '1'"> <out:call-template name="{$basename}.toolbar"> <out:with-param name="Rows" select="$Rows" /> </out:call-template> </xsl:if> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="Header"> <out:template name="{$basename}.header"> <out:param name="Rows"/> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="Body"> <out:template name="{$basename}.body"> <out:param name="Rows"/> <xsl:if test="$DoXSLJoin = '1'"> <out:param name="dvt_ParentRow"/> </xsl:if> <!-- add in the WSS form toolbar.--> <xsl:if test="$FormControlMode and $ShowTitle='1'"> <tr> <td class="ms-toolbar" nowrap="nowrap"> <table> <tr> <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td> <xsl:if test="not($FormControlMode = 'Display')"> <td class="ms-toolbar" nowrap="nowrap"> <SharePoint:SaveButton runat="server" ControlMode="{$FormControlMode}" id="savebutton1"/> </td> <td class="ms-separator"> </td> </xsl:if> <td class="ms-toolbar" nowrap="nowrap" align="right"> <SharePoint:GoBackButton runat="server" ControlMode="{$FormControlMode}" id="gobackbutton1"/> </td> </tr> </table> </td> </tr> <xsl:if test="$ShowFormToolbar='1'"> <tr> <td class="ms-toolbar" nowrap="nowrap"> <SharePoint:FormToolBar runat="server" ControlMode="{$FormControlMode}"/> </td> </tr> </xsl:if> </xsl:if> <xsl:choose> <xsl:when test="$FormControlMode='New'"> <xsl:choose> <xsl:when test="$GenerateForm = '1'"> <out:call-template name="{$basename}.rowedit"/> </xsl:when> <xsl:otherwise> <out:call-template name="{$basename}.rowview"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <out:for-each select="$Rows"> <!-- calls to .groupheader template go here --> <xsl:choose> <xsl:when test="$GenerateForm = '1'"> <out:call-template name="{$basename}.rowedit"/> </xsl:when> <xsl:otherwise> <out:call-template name="{$basename}.rowview"/> </xsl:otherwise> </xsl:choose> <!-- calls to .groupfooter template go here --> </out:for-each> </xsl:otherwise> </xsl:choose> <xsl:if test="$FormControlMode and $ShowTitle='1'"> <tr> <td class="ms-toolbar" nowrap="nowrap"> <table> <tr> <xsl:if test="not($FormControlMode = 'New')"> <td class="ms-descriptiontext" nowrap="nowrap"> <SharePoint:CreatedModifiedInfo ControlMode="{$FormControlMode}" runat="server"/> </td> </xsl:if> <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td> <xsl:if test="not($FormControlMode = 'Display')"> <td class="ms-toolbar" nowrap="nowrap"> <SharePoint:SaveButton runat="server" ControlMode="{$FormControlMode}" id="savebutton2"/> </td> <td class="ms-separator"> </td> </xsl:if> <td class="ms-toolbar" nowrap="nowrap" align="right"> <SharePoint:GoBackButton runat="server" ControlMode="{$FormControlMode}" id="gobackbutton2"/> </td> </tr> </table> </td> </tr> </xsl:if> </out:template> <xsl:apply-templates/> </xsl:template> <xsl:template match="RowInsert"> <out:template name="{$basename}.rowinsert"> <out:param name="IsInsertMode"/> <out:variable name="Pos">_new</out:variable> <xsl:apply-templates/> </out:template> </xsl:template> <xsl:template match="Footer"> <out:template name="{$basename}.footer"> <out:param name="Rows"/> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="Summary"> <out:template name="{$basename}.summary"> <out:param name="Rows" /> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="Empty"> <out:template name="{$basename}.empty"> <out:variable name="dvt_ViewEmptyText"> <xsl:value-of select="$dvt_ViewEmptyText" /> </out:variable> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="dvt_groupImage"> <img src="{{$imagesrc}}" border="0" alt="{{$alttext}}" name="{{$altname}}"/> </xsl:template> <xsl:template match="Toolbar"> <out:template name="{$basename}.toolbar"> <out:param name="Rows" /> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="ListViewToolbar"> <out:template name="{$basename}.listviewtoolbar"> <out:param name="Rows" /> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="RowView"> <out:template name="{$basename}.rowview"> <xsl:apply-templates/> </out:template> </xsl:template> <xsl:template match="RowEdit"> <out:template name="{$basename}.rowedit"> <xsl:apply-templates/> </out:template> </xsl:template> <xsl:template match="CommandFooter"> <out:template name="{$basename}.commandfooter"> <out:param name="FirstRow"/> <out:param name="LastRow"/> <out:param name="RowLimit"/> <out:param name="dvt_RowCount"/> <out:param name="RealLastRow"/> <xsl:apply-templates/> </out:template> </xsl:template> <xsl:template match="FormActions"> <out:template name="{$basename}.formactions"> <xsl:apply-templates/> </out:template> </xsl:template> <xsl:template match="AutoMode"> <out:template name="{$basename}.automode"> <out:param name="KeyField"/> <out:param name="KeyValue"/> <out:param name="Mode"/> <xsl:choose> <xsl:when test="text() = 'vertical'"> <xsl:apply-templates select="msxsl:node-set($Defaults)/AutoModeVertical/*"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/AutoModeHorizontal/*"/> </xsl:otherwise> </xsl:choose> </out:template> </xsl:template> <xsl:template match="Navigation"> <out:template name="{$basename}.navigation"> <out:param name="FirstRow"/> <out:param name="LastRow"/> <out:param name="RowLimit"/> <out:param name="dvt_RowCount"/> <out:param name="RealLastRow"/> <out:variable name="PrevRow"> <out:choose> <out:when test="$FirstRow - $RowLimit < 1">1</out:when> <out:otherwise> <out:value-of select="$FirstRow - $RowLimit"/> </out:otherwise> </out:choose> </out:variable> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="GroupHeader"> <out:template name="{$basename}.groupheader"> <out:param name="fieldtitle"/> <out:param name="fieldname"/> <out:param name="fieldvalue"/> <out:param name="fieldtype"/> <out:param name="nodeset"/> <out:param name="groupid"/> <out:param name="displaystyle"/> <out:param name="imagesrc"/> <out:param name="alttext"/> <out:param name="altname"/> <out:param name="hidedetail"/> <out:param name="showheader"/> <out:param name="showheadercolumn"/> <xsl:apply-templates /> </out:template> </xsl:template> <xsl:template match="GroupFooter"> <out:template name="{$basename}.groupfooter"> <out:param name="fieldtitle"/> <out:param name="fieldname"/> <out:param name="fieldvalue"/> <out:param name="fieldtype"/> <out:param name="nodeset"/> <out:param name="groupid"/> <out:param name="displaystyle"/> <out:param name="showfooter"/> <out:param name="showfootercolumn"/> <xsl:apply-templates /> </out:template> </xsl:template> <!-- templates to generate default parts of views --> <xsl:template name="GenEmpty"> <xsl:choose> <xsl:when test="Empty"> <xsl:apply-templates select="Empty" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Empty" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenHeader"> <xsl:choose> <xsl:when test="Header"> <xsl:apply-templates select="Header" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Header" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenFooter"> <xsl:choose> <xsl:when test="Footer"> <xsl:apply-templates select="Footer" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Footer" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenSummary"> <xsl:choose> <xsl:when test="Summary"> <xsl:apply-templates select="Summary" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Summary" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenToolbar"> <xsl:choose> <xsl:when test="Toolbar"> <xsl:apply-templates select="Toolbar" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Toolbar" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenLVToolbar"> <xsl:choose> <xsl:when test="ListViewToolbar"> <xsl:apply-templates select="ListViewToolbar" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/ListViewToolbar" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenCommandFooter"> <xsl:choose> <xsl:when test="CommandFooter"> <xsl:apply-templates select="CommandFooter" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/CommandFooter" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenFormActions"> <xsl:choose> <xsl:when test="CommandFooter"> <xsl:apply-templates select="FormActions" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/FormActions" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenNavigation"> <xsl:choose> <xsl:when test="Navigation"> <xsl:apply-templates select="Navigation" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="msxsl:node-set($Defaults)/Navigation" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="GenRowInsert"> <xsl:if test="RowInsert"> <xsl:apply-templates select="RowInsert"/> </xsl:if> </xsl:template> <!-- implement the known tags in the "dvt" namespace --> <!-- this tag only works in Navigation template --> <xsl:template match="dvt_PrevLink"> <!-- DSP paging does not support previous; use browser history link instead --> <!-- if we are doing xsl paging, then we can simply pass the firstrow value --> <a> <out:attribute name="href"> <xsl:choose> <xsl:when test="not($DoXSLPaging = '1')">javascript: history.back();</xsl:when> <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$PrevRow,'}}'))" />;</xsl:otherwise> </xsl:choose> </out:attribute> <img src="/_layouts/images/prev.gif" border="0" alt="{$PreviousLinkText}"/> </a> </xsl:template> <!-- this tag only works in Navigation template --> <xsl:template match="dvt_NextLink"> <!-- if we are doing DSP paging, then we have to pass the dvt_nextpagedata back as the dvt_startposition --> <!-- if we are doing xsl paging, then we can simply pass the firstrow value --> <out:if test="$LastRowValue < $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1"> <a> <out:attribute name="href"> <xsl:choose> <xsl:when test="not($DoXSLPaging = '1')">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$NextRow,'}};dvt_startposition={{',$dvt_nextpagedata,'}}'))" />;</xsl:when> <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$NextRow,'}}'))" />;</xsl:otherwise> </xsl:choose> </out:attribute> <img src="/_layouts/images/next.gif" border="0" alt="{$NextLinkText}"/> </a> </out:if> </xsl:template> <!-- this tag only works in Navigation template --> <xsl:template match="dvt_FirstLink"> <a> <out:attribute name="href"> <xsl:choose> <!-- if we are doing DSP paging, then we have to pass the firstrow and the dvt_startposition --> <xsl:when test="not($DoXSLPaging = '1')">javascript: <out:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={{1}};dvt_startposition={{}}')" />;</xsl:when> <!-- if we are doing xsl paging, then we can simply pass the firstrow value --> <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={{1}}')" />;</xsl:otherwise> </xsl:choose> </out:attribute> <xsl:value-of select="$FirstLinkText"/> </a> </xsl:template> <!-- this tag only works in Navigation template --> <xsl:template match="dvt_IfNotFirstPage"> <out:if test="$dvt_firstrow > 1" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <!-- this tag belongs in the FormActions template --> <xsl:template match="dvt_SaveButton"> <input type="button" value="{$SaveButtonText}" name="btnSave" onclick="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"/> </xsl:template> <!-- this tag belongs in the FormActions template --> <xsl:template match="dvt_CancelButton"> <input type="button" value="{$CancelButtonText}" name="btnCancel" onclick="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"/> </xsl:template> <xsl:template match="dvt_InsertLink"> <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel;{$basename}_form_insertmode={{1}}')}}"><xsl:value-of select="$InsertLinkText"/></a> </xsl:template> <xsl:template match="dvt_SaveEditLink"> <a href="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"><xsl:value-of select="$SaveLinkText"/></a> </xsl:template> <xsl:template match="dvt_SaveInsertLink"> <a href="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"><xsl:value-of select="$SaveLinkText"/></a> </xsl:template> <xsl:template match="dvt_CancelEditLink"> <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"><xsl:value-of select="$CancelLinkText"/></a> </xsl:template> <xsl:template match="dvt_CancelInsertLink"> <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"><xsl:value-of select="$CancelLinkText"/></a> </xsl:template> <xsl:template match="dvt_EditLink"> <a href="javascript: {{ddwrt:GenFireServerEvent(concat('__cancel;{$basename}_form_editkey={{',$KeyValue,'}}'))}}"><xsl:value-of select="$EditLinkText"/></a> </xsl:template> <xsl:template match="dvt_DeleteLink"> <a href="javascript: {{ddwrt:GenFireServerEvent(concat('__cancel;__delete={{',$KeyField,'=',$KeyValue,'}};__commit'))}}"><xsl:value-of select="$DeleteLinkText"/></a> </xsl:template> <xsl:template match="dvt_Header"> <xsl:if test="$ShowHeader = '1'" ddwrt:cf_ignore="1"> <out:call-template name="{$basename}.header" > <out:with-param name="Rows" select="$Rows"/> </out:call-template> </xsl:if> </xsl:template> <xsl:template match="dvt_Body"> <out:call-template name="{$basename}.body"> <out:with-param name="Rows" select="$Rows"/> <xsl:if test="$DoXSLJoin = '1'"> <out:with-param name="dvt_ParentRow" select="$dvt_ParentRow"/> </xsl:if> </out:call-template> </xsl:template> <xsl:template match="dvt_UploadMenu"> <xsl:if test="$DocLib='1'"> <td class="ms-toolbar" nowrap="nowrap"> <SharePoint:UploadMenu runat="server"/> </td> <td class="ms-toolbar">|</td> </xsl:if> </xsl:template> <xsl:template match="dvt_AutoMode"> <xsl:variable name="KeyFieldSelect"> <xsl:choose> <!-- if there is a field with a KeyName --> <xsl:when test="count($View/Fields/Field[string-length(@KeyName) != 0]) > 0"> <xsl:value-of select="$View/Fields/Field[string-length(@KeyName) != 0]/@KeyName"/> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="KeyValueSelect"> <xsl:choose> <!-- if there is a field with a KeyXPath --> <xsl:when test="count($View/Fields/Field[string-length(@KeyXPath) != 0]) > 0"> <xsl:value-of select="$View/Fields/Field[string-length(@KeyXPath) != 0]/@KeyXPath"/> </xsl:when> <xsl:otherwise>''</xsl:otherwise> </xsl:choose> </xsl:variable> <!-- put the values needed to make the automode template call in attributes of a span tag --> <span ddwrt:amkeyfield="{$KeyFieldSelect}" ddwrt:amkeyvalue="{$KeyValueSelect}" ddwrt:ammode="{@mode}"></span> <!-- <out:call-template name="{$basename}.automode"> <out:with-param name="KeyField"> <xsl:value-of select="$KeyFieldSelect"/> </out:with-param> <out:with-param name="KeyValue"> <xsl:attribute name="select"> <xsl:value-of select="$KeyValueSelect"/> </xsl:attribute> </out:with-param> <out:with-param name="Mode"> <xsl:value-of select="@mode"/> </out:with-param> </out:call-template> --> </xsl:template> <xsl:template match="dvt_Footer"> <xsl:if test="$ShowFooter = '1'" ddwrt:cf_ignore="1"> <out:call-template name="{$basename}.footer"> <out:with-param name="Rows" select="$Rows"/> </out:call-template> </xsl:if> </xsl:template> <xsl:template match="dvt_FormActions"> <out:call-template name="{$basename}.formactions"/> </xsl:template> <!-- designed to be called from within the commandfooter template --> <xsl:template match="dvt_Navigation"> <out:if> <xsl:attribute name="test"> <xsl:choose> <xsl:when test="$DoXSLPaging = '1'">$FirstRow > 1 or $LastRow < $dvt_RowCount</xsl:when> <xsl:otherwise>$FirstRow > 1 or $dvt_nextpagedata</xsl:otherwise> </xsl:choose> </xsl:attribute> <out:call-template name="{$basename}.navigation"> <out:with-param name="FirstRow" select="$FirstRow"/> <out:with-param name="LastRow" select="$LastRow"/> <out:with-param name="RowLimit" select="$RowLimit"/> <out:with-param name="dvt_RowCount" select="$dvt_RowCount"/> <out:with-param name="RealLastRow" select="$RealLastRow"/> </out:call-template> </out:if> </xsl:template> <xsl:template name="GenFieldView"> <xsl:param name="ThisField"/> <xsl:call-template name="gen-field-view"> <xsl:with-param name="xpath" select="$ThisField/@Value"/> <xsl:with-param name="title" select="$ThisField/@Title"/> <xsl:with-param name="type" select="$ThisField/@Type"/> <xsl:with-param name="rich" select="$ThisField/@Rich"/> </xsl:call-template> </xsl:template> <xsl:template name="GenFieldForm"> <xsl:param name="ThisField"/> <xsl:param name="IsInsertField"/> <xsl:call-template name="gen-field-form"> <xsl:with-param name="xpath" select="$ThisField/@Value"/> <xsl:with-param name="xpathraw" select="$ThisField/@ValueRaw"/> <xsl:with-param name="title" select="$ThisField/@Title"/> <xsl:with-param name="type" select="$ThisField/@Type"/> <xsl:with-param name="keyname" select="$ThisField/@KeyName"/> <xsl:with-param name="keyxpath" select="$ThisField/@KeyXPath"/> <xsl:with-param name="formfieldprefix" select="$ThisField/@FormFieldPrefix"/> <xsl:with-param name="choices" select="$ThisField/Choices"/> <xsl:with-param name="outputformat" select="$ThisField/@OutputFormat" /> <xsl:with-param name="IsInsertField" select="$IsInsertField"/> </xsl:call-template> </xsl:template> <xsl:template match="dvt_FieldView"> <xsl:param name="ThisField"/> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:template> <xsl:template match="dvt_FieldView[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:template> <xsl:template match="dvt_FieldEdit"> <xsl:param name="ThisField"/> <xsl:choose> <xsl:when test="$ThisField/@ReadOnly = '0'"> <xsl:call-template name="GenFieldForm"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="dvt_FieldEdit[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <xsl:choose> <xsl:when test="$ThisField/@ReadOnly = '0'"> <xsl:call-template name="GenFieldForm"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="dvt_FieldInsert"> <xsl:param name="ThisField"/> <xsl:choose> <xsl:when test="$ThisField/@ReadOnly = '0'"> <xsl:call-template name="GenFieldForm"> <xsl:with-param name="ThisField" select="$ThisField"/> <xsl:with-param name="IsInsertField" select="'1'"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="dvt_FieldInsert[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <xsl:choose> <xsl:when test="$ThisField/@ReadOnly = '0'"> <xsl:call-template name="GenFieldForm"> <xsl:with-param name="ThisField" select="$ThisField"/> <xsl:with-param name="IsInsertField" select="'1'"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="GenFieldView"> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="dvt_FieldTitle[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <xsl:value-of select="$ThisField/@Title" /> <xsl:if test="$ThisField/@Required = '1' and $FormControlMode and $GenerateForm = '1'"> <span class="ms-formvalidation"> *</span> </xsl:if> </xsl:template> <xsl:template match="dvt_FieldTitle"> <xsl:param name="ThisField"/> <xsl:value-of select="$ThisField/@Title" /> <xsl:if test="$ThisField/@Required = '1' and $FormControlMode and $GenerateForm = '1'"> <span class="ms-formvalidation"> *</span> </xsl:if> </xsl:template> <xsl:template match="dvt_FieldHeader[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <out:variable name="{$ThisField/@FName}"> <out:call-template name="dvt.headerfield"> <out:with-param name="fieldname"> <xsl:value-of select="$ThisField/@Value"/> </out:with-param> <out:with-param name="fieldtitle"> <xsl:value-of select="$ThisField/@Title"/> </out:with-param> <out:with-param name="displayname"> <xsl:value-of select="$ThisField/@Title"/> </out:with-param> </out:call-template> </out:variable> <out:copy-of select="${$ThisField/@FName}" /> </xsl:template> <xsl:template match="dvt_FieldHeader"> <xsl:param name="ThisField"/> <out:variable name="{$ThisField/@FName}"> <out:call-template name="dvt.headerfield"> <out:with-param name="fieldname"> <xsl:value-of select="$ThisField/@Value"/> </out:with-param> <out:with-param name="fieldtitle"> <xsl:value-of select="$ThisField/@Title"/> </out:with-param> <out:with-param name="displayname"> <xsl:value-of select="$ThisField/@Title"/> </out:with-param> </out:call-template> </out:variable> <out:copy-of select="${$ThisField/@FName}" /> </xsl:template> <xsl:template match="dvt_FieldFilter"> <xsl:param name="ThisField"/> <out:call-template name="dvt.filterfield"> <out:with-param name="fieldname"> <!-- Remove synthetized ddw prefixes used for default namespaces when calling into the dvt.filterfield template. --> <xsl:choose> <xsl:when test="contains($ThisField/@Value, ':') and starts-with($ThisField/@Value, 'ddw')"> <xsl:value-of select="substring-after($ThisField/@Value, ':')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$ThisField/@Value"/> </xsl:otherwise> </xsl:choose> </out:with-param> <out:with-param name="fieldtitle"> <!-- Remove synthetized ddw prefixes used for default namespaces when calling into the dvt.filterfield template. --> <xsl:choose> <xsl:when test="contains($ThisField/@Title, ':') and starts-with($ThisField/@Title, 'ddw')"> <xsl:value-of select="substring-after($ThisField/@Title, ':')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$ThisField/@Title"/> </xsl:otherwise> </xsl:choose> </out:with-param> <out:with-param name="Rows" select="$Rows"/> <out:with-param name="fieldtype"> <xsl:value-of select="$ThisField/@Type"/> </out:with-param> </out:call-template> </xsl:template> <xsl:template match="dvt_FieldFilter[@Name]"> <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/> <out:call-template name="dvt.filterfield"> <out:with-param name="fieldname"> <xsl:value-of select="$ThisField/@Value"/> </out:with-param> <out:with-param name="fieldtitle"> <xsl:value-of select="$ThisField/@Title"/> </out:with-param> <out:with-param name="Rows" select="$Rows"/> <out:with-param name="fieldtype"> <xsl:value-of select="$ThisField/@Type"/> </out:with-param> </out:call-template> </xsl:template> <xsl:template match="dvt_ForEachField"> <xsl:if test="$TopLevel = '1' or not(@TopLevel)"> <xsl:variable name="CurNode" select="."/> <xsl:variable name="ReqFields"> <xsl:if test="@ExcludeRequired"> <xsl:for-each select="$Style/RequiredFields/Field"> <xsl:text> </xsl:text> <xsl:value-of select="@Name"/> <xsl:text> </xsl:text> </xsl:for-each> </xsl:if> </xsl:variable> <xsl:for-each select="$View/Fields/Field[not(@Hidden) and not(contains($ReqFields,concat(' ',@FName,' ')))]"> <xsl:variable name="ThisField" select="."/> <xsl:variable name="FieldNum" select="position()"/> <xsl:apply-templates select="$CurNode/node()"> <xsl:with-param name="ThisField" select="$ThisField"/> <xsl:with-param name="FieldNum" select="$FieldNum"/> </xsl:apply-templates> </xsl:for-each> </xsl:if> </xsl:template> <xsl:template match="dvt_ForEachRow"> <out:for-each select="{$View/RowPath}"> <xsl:apply-templates select="node()"/> </out:for-each> </xsl:template> <xsl:template match="dvt_IfNotEmpty"> <out:if test="count({$View/RowPath})!=0"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfTitleEmpty"> <out:if test="$fieldtitle"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfEmpty"> <out:if test="count({$View/RowPath})=0"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfNewGroup"> <xsl:if test="$View/Sorting[@Grouping='TRUE']"> <out:if test="$NewGroup = 'TRUE'" ddwrt:cf_ignore="1"> <xsl:apply-templates> <xsl:with-param name="ThisField" select="$View/Fields/Field[@FName=$View/Sorting/SortBy[1]/@Field]"/> </xsl:apply-templates> </out:if> </xsl:if> </xsl:template> <xsl:template match="dvt_IfEvenRow"> <out:if test="position() mod 2 = 0" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfOddRow"> <out:if test="position() mod 2 != 0" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfFirstRow"> <out:if test="position() = 1" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfLastRow"> <out:if test="position() = last()" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfNotFirstRow"> <out:if test="position() != 1" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfNotLastRow"> <out:if test="position() != last()" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_AlternateRow"> <out:if test="position() mod 2 = 1"> <out:attribute name="class">ms-alternating</out:attribute> </out:if> </xsl:template> <xsl:template match="dvt_IfAutoMode"> <out:if test="${$basename}_automode = '1'" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfFirstField"> <xsl:param name="FieldNum"/> <xsl:if test="$FieldNum = 1"> <xsl:apply-templates/> </xsl:if> </xsl:template> <xsl:template match="dvt_IfNotFirstField"> <xsl:param name="FieldNum"/> <xsl:if test="$FieldNum != 1"> <xsl:apply-templates/> </xsl:if> </xsl:template> <xsl:template match="dvt_IfVarEq"> <out:if test="${@name} = '{@value}'" ddwrt:cf_ignore="1"> <xsl:apply-templates/> </out:if> </xsl:template> <xsl:template match="dvt_IfGenerateForm"> <xsl:if test="$GenerateForm = '1'"> <xsl:apply-templates/> </xsl:if> </xsl:template> <xsl:template match="dvt_WhenInsertMode"> <out:when test="$IsInsertMode = '1'"> <xsl:apply-templates/> </out:when> </xsl:template> <xsl:template match="dvt_WhenAutoModeEdit"> <out:when test="$Mode = 'edit'"> <xsl:apply-templates/> </out:when> </xsl:template> <xsl:template match="dvt_WhenAutoModeInsert"> <out:when test="$Mode = 'insert'"> <xsl:apply-templates/> </out:when> </xsl:template> <xsl:template match="dvt_HTML"><out:text disable-output-escaping="yes"><xsl:apply-templates/></out:text></xsl:template> <xsl:template match="dvt_NBSP"><out:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes"> </out:text></xsl:template> <xsl:template match="dvt_Comment"><out:comment><xsl:apply-templates/></out:comment></xsl:template> <xsl:template match="dvt_GetVar"> <out:value-of select="${@Name}"/> </xsl:template> <xsl:template match="dvt_ShowVar"> <out:value-of select="{@Name}"/> </xsl:template> <xsl:template match="dvt_DisplayVar"> <out:value-of select="${@Name}" disable-output-escaping="yes"/> </xsl:template> <xsl:template match="dvt_ChooseText"> <xsl:value-of select="$ChooseText"/> </xsl:template> <xsl:template match="dvt_PageItemText"> <xsl:value-of select="$PageItemText" disable-output-escaping="yes"/> </xsl:template> <xsl:template match="dvt_PageItemsText"> <out:value-of select="$FirstRow"/> - <out:value-of select="$LastRowValue"/> </xsl:template> <xsl:template match="dvt_ViewText"> <xsl:value-of select="$ViewText"/> </xsl:template> <xsl:template match="dvt_CountText"> <xsl:value-of select="$CountText" disable-output-escaping="yes"/> </xsl:template> <xsl:template match="*"> <xsl:param name="ThisField"/> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates> <xsl:with-param name="ThisField" select="$ThisField"/> </xsl:apply-templates> </xsl:copy> </xsl:template> </xsl:stylesheet>